import { formatDateTime } from "@/framework/util/date";
import { round, round1, round2 } from "@/framework/util/numbers";

export const renderTableDateTime = ({ text: time }: any) => (time == null || time <= 0 ? "-" : formatDateTime(time));

export const renderRound1 = ({ text: value }: any) => round1(value)?.toFixed(1);
export const renderRound2 = ({ text: value }: any) => round2(value)?.toFixed(2);
export const renderRound3 = ({ text: value }: any) => round(value, 3)?.toFixed(3);
export const renderRound4 = ({ text: value }: any) => round(value, 4)?.toFixed(4);
